<?php
namespace app\admin\controller;

use think\facade\Cache as C;

class Cache extends \app\common\controller\ApiCommon {
    /**
     * recache the menu cache
     * 
     * 
     * @return <type>
     */
	public function user_menu(){
		if (C::clear('USER_MENU')) {
			return json_pack('OK');
		} else {
			return json_pack('FAILURE!',400);
		}
	}
	
	public function system_config() {
		if (cache('DB_CONFIG_DATA', null)) {
			return json_pack('OK');
		} else {
			return json_pack('FAILURE!',400);
		}
	}
	
	public function admin_rule() {
		if (cache('AUTH_RULE_LIST', null)) {
			return json_pack('OK');
		} else {
			return json_pack('FAILURE!',400);
		}
	}
	
	public function group_access() {
		if (C::clear('GROUP_ACCESS')) {
			return json_pack('OK');
		} else {
			return json_pack('FAILURE!',400);
		}
	}
	
	// public function index(){
		// cache('DB_CONFIG_DATA');
		// return json_pack(config('DB_CONFIG_DATA'));
	// }
}

?>